<template>
	<view class="page" :style="themeColor">
		<view class="flex benben-position-layout flex flex-wrap align-center conceal_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between flex-sub conceal_fd0_0'>
				<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
					<text class='fu-iconfont2  conceal_fd0_0_c0_c0' @tap.stop="handleJumpDiy" data-type="back"
						data-url="1">&#xE794;</text>
				</view>
				<view class='flex flex-wrap align-stretch justify-center flex-sub'>
					<text class='conceal_fd0_0_c1_c0' v-if="type == 1">注册协议</text>
					<text class='conceal_fd0_0_c1_c0' v-if="type == 2">隐私政策</text>
					<text class='conceal_fd0_0_c1_c0' v-if="type == 3">成年人使用政策</text>
					<text class='conceal_fd0_0_c1_c0' v-if="type == 7">文本和法律条件</text>
				</view>
				<view class='flex flex-wrap align-center conceal_fd0_0_c2'>
				</view>
			</view>
		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		<view class="loading_css" v-if="isShow">
			<u-loading size="36" color="#6A0002"></u-loading>
			<view class="loading_text">加载中</view>
		</view>
		<view class="ben_fu-jyf-parser_1" v-else>
			<!-- <jyf-parser :html="parser1 | richTextFormat"></jyf-parser> -->
			<u-parse :html="parser1"></u-parse>
		</view>

	</view>
</template>
<script>
	export default {
		components: {},


		data() {
			return {
				"parser1": "",
				"type": "1",  // 1用户协议  2隐私政策  3成年人使用政策
				aid: '',
				isShow: true
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			let {
				type
			} = options
			if (type !== undefined) this.type = type;
			if (this.type == 1 || this.type == 2 || this.type == 7) {
				this.getxieyi();
			} else if (this.type == 3) {
				this.getxieyi2();
			}
			
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			async getxieyi() {
				if (this.type == 1) {
					this.aid = 1
				} else if (this.type == 2) {
					this.aid = 2
				} else if (this.type == 7) {
					this.aid = 7
				}
				let res = await this.$api.post(global.apiUrls.xieyi, {
					aid: this.aid
				});
				setTimeout(() => {
					this.isShow = false;
				}, 800)
				if (res.data.code != 1) {
					this.$message.info(res.data.msg)
					return
				}
				this.parser1 = res.data.data.content
				// console.log(this.parser1, 'this.parser1')
			},
			async getxieyi2() {
				let res = await this.$api.post(global.apiUrls.xieyi, {
					aid: 5
				});
				// console.log(res, 'ressssssss')
				this.isShow = false;
				if (res.data.code != 1) {
					this.$message.info(res.data.msg)
					return
				}
				this.parser1 = res.data.data.content
			},
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #F8F8F8;
		background-size: 100% auto !important;
	}

	.conceal_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.conceal_fd0_0_c2 {
		width: 32rpx;
		height: 32rpx;
	}

	.conceal_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
		line-height: 88rpx;
	}

	.conceal_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333;
		line-height: 88rpx;
	}

	.conceal_fd0_0 {
		margin: 0rpx 32rpx 0rpx 32rpx;
	}

	.ben_fu-jyf-parser_1 {
		padding-left: 32rpx;
		padding-right: 32rpx;
		padding-top: 32rpx;
		padding-bottom: 32rpx;

	}
</style>